#ifndef ENTITYDECLARATIVE_H
#define ENTITYDECLARATIVE_H

#include <core/entity.h>
#include <QDeclarativeItem>
#include <QtScript>

namespace Opl
{
	namespace Core
	{

		class CORE_EXPORT EntityDeclarative : public QDeclarativeItem, public Entity
		{
				Q_OBJECT
				Q_PROPERTY(QVariant tag READ tag WRITE setTag)
				Q_PROPERTY(QUuid unique READ unique)
				Q_PROPERTY(QDateTime unique READ stamp)
			public:
				static QString ID;
				EntityDeclarative(EntityDeclarative* parent = 0);
				virtual ~EntityDeclarative();
				virtual QString toString();

				static void fromScriptValue(const QScriptValue& object, EntityDeclarative*& out);
				static QScriptValue toScriptValue(QScriptEngine* engine, EntityDeclarative* const& in);
				static QScriptValue construct_Script(QScriptContext*, QScriptEngine* engine);
		};

	}
}

Q_DECLARE_METATYPE(Opl::Core::EntityDeclarative*)
#endif // ENTITYDECLARATIVE_H
